CC=gcc
CFLAGS=-Wall -g
LIBPATH=../../../..
INCLS=-I$(LIBPATH)/include
LIBS=-L$(LIBPATH)/lib -lsoar_g -lpthread
OS=$(shell uname)
ifeq ($(OS), Linux)
    LIBS+=-lrt
endif

BINS=client server
BINS_MULTI=client_multi server_multi

all : $(BINS) $(BINS_MULTI)

$(BINS) : % : %.c
	$(CC) $(CFLAGS) $(INCLS) -o $@ $< $(LIBS)
	chmod 744 $@ 

$(BINS_MULTI) : %_multi : %.c
	$(CC) $(CFLAGS) $(INCLS) -D_MY_MULTI -o $@ $< $(LIBS)
	chmod 744 $@

clean :
	rm -f core* $(BINS) $(BINS_MULTI)
